package k.b.s;

import android.app.Activity;
import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class DBTestBuild extends Activity{
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dtb);
	}
	public void onClickDTB(View v){
		Database databaseOpenHelper = new Database(this);
		SQLiteDatabase database = null;

		database = databaseOpenHelper.getWritableDatabase();

		ContentValues values = new ContentValues();
		values.put("title", "title1");
		values.put("description", "description1");
		values.put("pubdate", 0);
		values.put("isread", 0);

		long rowId = database.insert("VANGUARD_TB", null, values);
		Log.v("AddActivity", "RowID:" + rowId);

		values = new ContentValues();
		values.put("title", "title2");
		values.put("description", "description2");
		values.put("pubdate", 0);
		values.put("isread", 0);

		rowId = database.insert("VANGUARD_TB", null, values);
		Log.v("AddActivity", "RowID:" + rowId);

		if (databaseOpenHelper != null) {
			databaseOpenHelper.close();
		}
	}
}
